home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / TURBOCU2.LZH / ECLIB.ARC / ECON.DOC next >
Text File  |  1987-07-15  |  8KB  |  167 lines

  1.     I haven't had time to write a fancy document on the routines so
  2. I will just tell you what goes in, what they do, and what they return.
  3.  
  4.     These routines support video modes 0 thru 7, updating the cursor
  5. position after each output to the screen.  The are considerably
  6. faster than the routines available thru BIOS.
  7.  
  8.     These routines have been well tested as far as CGA output goes,
  9. except the snow control routines.  These routines were designed after
  10. what is used in fastwrit.c so snow should not be a problem.  The
  11. monocrome were routines were just desk checked, no hardware, but if
  12. you have a problem, let me know I will upload a fix within a few days.
  13.  
  14.     Any requests for features you'd like to see are more than welcome.
  15. I will not be implementing windowing in these routines, thats reserved
  16. for my next project.
  17.  
  18.     These routines are available for any kind of use you desire to
  19. put them to, no fee of any kind is expected or desired.  They may be
  20. used in comercial, shareware, or public domain software as desired.
  21. For those who desire the source look for DL member ECSRC.ARC.  If you
  22. distribute these files, be prepared to support the users on the
  23. bulliten board you post them on, or refer them here.  If you use my
  24. course in programs you distribute, I'd appreciate an acknowledgement.
  25. Anything I forgot to say, just ask, I read most messages in section 11
  26. of the board.
  27.  
  28.                           Joe Odenweller
  29.                       compuserve id [76266,170]
  30. ------------------------------------------------------------------------
  31. int ecattr(int attribute);
  32.  
  33. input:
  34.    attribute is an integer specifying the attribute to be used on
  35.       the current page.  The attribute is used on all output to
  36.       the screen for the current page and mode.
  37. return:
  38.    The routine returns the new attribute or EOF if the attribute is
  39.       invalid for the current mode.
  40. purpose:
  41.    Use this routine to set the attribute to be used on all further
  42.       output to the screen.  B&W modes will only accept 0x07, 0x70,
  43.       0x00, and 0x77.  Color modes will accept any value.  This value
  44.       is not currently used for mode 6.
  45. ------------------------------------------------------------------------
  46. extern unsigned int ec_bufsz;
  47.  
  48. This variable expresses the largest output you can generate thru
  49.    ecprintf().    If set too small will cause overwriting portions
  50.    of the program.  The default value is 255.
  51. ------------------------------------------------------------------------
  52. extern unsigned char ec_dattr_cga;
  53.  
  54. This variable expresses the default attribute to be used on output
  55.    to the screen for CGA modes.
  56. ------------------------------------------------------------------------
  57. extern unsigned char ec_dattr_mono;
  58.  
  59. This variable expresses the default attribute to be used on output
  60.    to the screen for Monocrome modes.
  61. ------------------------------------------------------------------------
  62. int ecprintf(char *format, ...);
  63.  
  64. returns:
  65.    This returns the last character printed, zero if output is null,
  66.       or an EOF if an error occured with either allocation or
  67.       use of a temporary buffer allocated.  If EOF is returned you
  68.       should probably end the program immediately.
  69. purpose:
  70.    This acts like just like the cprintf routine with the following
  71.       differences.  This routine is almost as fast as fastwrit.c.
  72.       The control chartacter \b causes a backspace, backspacing past
  73.       the beginning of the screen is not supported.  \t causes a
  74.       forward jump to the next tab stop. \r causes a carraige return
  75.       without a line feed. \n causes a line feed without a carraige
  76.       return.  \f causes the screen to be cleared and filled with the
  77.       current attribute, and the cursor reset to the upper left hand
  78.       corner.  This routine will scroll down.  This routine calls
  79.       ecputs() to do the actual output.
  80. ------------------------------------------------------------------------
  81. int ecputc(char character);
  82.  
  83. returns:
  84.    This returns the last character printed, zero if output is null.
  85. purpose:
  86.    This acts like just like the cputc routine with the following
  87.       differences.  This routine is almost as fast as fastwrit.c.
  88.       The control chartacter \b causes a backspace, backspacing past
  89.       the beginning of the screen is not supported.  \t causes a
  90.       forward jump to the next tab stop. \r causes a carraige return
  91.       without a line feed. \n causes a line feed without a carraige
  92.       return.  \f causes the screen to be cleared and filled with the
  93.       current attribute, and the cursor reset to the upper left hand
  94.       corner.  This routine will scroll down.  This routine calls
  95.       ecputs() to do the actual output.
  96. ------------------------------------------------------------------------
  97. int ecputs(char *string);
  98.  
  99. returns:
  100.    This returns the last character printed, zero if output is null.
  101. purpose:
  102.    This acts like just like the cputs routine with the following
  103.       differences.  This routine is almost as fast as fastwrit.c.
  104.       The control chartacter \b causes a backspace, backspacing past
  105.       the beginning of the screen is not supported.  \t causes a
  106.       forward jump to the next tab stop. \r causes a carraige return
  107.       without a line feed. \n causes a line feed without a carraige
  108.       return.  \f causes the screen to be cleared and filled with the
  109.       current attribute, and the cursor reset to the upper left hand
  110.       corner.  This routine will scroll down.
  111. ------------------------------------------------------------------------
  112. int ecseek(int page, long offset, int fromwhere);
  113.  
  114. input:
  115.    page is the page to make active.
  116.    offset is an encoded variable containing the row and column
  117.       changes.    Negatives are valid.  See MK_CS.
  118.    fromwhere defines how offset is to be used in positioning the
  119.       cursor.  Possible values are SEEK_SET which takes the row
  120.       and column as the absolute position, SEEK_CUR specifies to
  121.       add the offset to the current position, and SEEK_END says to
  122.       add the offset to the value for the end of screen (row = 25,
  123.       col = 0).
  124. returns:
  125.    This returns EOF the page is invalid, zero otherwise.
  126. purpose:
  127.    To position the cursor on the screen.  Positioning off the screen
  128.       will cause the appropriate amount of scrolling in the up or down
  129.       direction.  Do not use this to clear the screen, ecprintf("\f");
  130.       is much faster.
  131. ------------------------------------------------------------------------
  132. long ectell(int page);
  133.  
  134. input:
  135.    page is the page to be examined.
  136. returns:
  137.    The encoded cursor address. See CS_ROW and CS_COL.
  138. purpose:
  139.    To determine current position on the screen.
  140. ------------------------------------------------------------------------
  141. int CS_ROW(long offset); /* MACRO */
  142.  
  143. input:
  144.    offset as generated by MK_CS() or ectell();
  145. returns:
  146.    The row contained in the offset.
  147. purpose:
  148.    To determine row contained in the long returned by ectell();
  149. ------------------------------------------------------------------------
  150. int CS_COL(long offset); /* MACRO */
  151.  
  152. input:
  153.    offset as generated by MK_CS() or ectell();
  154. returns:
  155.    The column contained in the offset.
  156. purpose:
  157.    To determine column contained in the long returned by ectell();
  158. ------------------------------------------------------------------------
  159. int MK_CS(int row, int column); /* MACRO */
  160.  
  161. input:
  162.    row and column to be inserted into the offset.
  163. returns:
  164.    The offset used by ecseek().
  165. purpose:
  166.    To construct the offset parameter used by ecseek().
  167.